package com.runshu.config;

import com.runshu.webserver.IWebServer;
import org.apache.cxf.Bus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.xml.ws.Endpoint;

/**
 * cxf发布webservice配置
 *
 * @author dhs
 * @date 2020-05-06
 */
@Configuration
public class CxfConfig {

    @Autowired
    private Bus bus;

    @Autowired
    private IWebServer studentService;

    /**
     * 站点服务
     * @return
     */
    @Bean
    public Endpoint studentServiceEndpoint(){
        EndpointImpl endpoint = new EndpointImpl(bus,studentService);
        endpoint.publish("/IWebServer");
        return endpoint;
    }
}
